package com.cskaoyan.bean.wx_coupon;

import com.cskaoyan.bean.promotion.coupon.Coupon;
import com.cskaoyan.bean.promotion.coupon.CouponUser;
import com.cskaoyan.util.DateUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;

/**
 * @Description:
 * @Author: WD created on 2021-09-19 11:32
 * @Version:
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class WXMyListInnerCoupon {

    private Integer id;
    private Integer cid;
    private String name;
    private String desc;
    private String tag;
    private Double min;
    private Double discount;
    private String startTime;
    private String endTime;
    private Boolean available;


    public WXMyListInnerCoupon(Coupon coupon, Integer id, Boolean available) {
        this.id = id;
        this.cid = coupon.getId();
        this.name = coupon.getName();
        this.desc = coupon.getDesc();
        this.tag = coupon.getTag();
        this.min = coupon.getMin();
        this.discount = coupon.getDiscount();
        this.startTime = DateUtils.dateFormat(coupon.getStartTime());
        this.endTime = DateUtils.dateFormat(coupon.getEndTime());
        this.available = available;
    }
}
